package servlets;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.ArticleAdm;
import bean.Articles;

@SuppressWarnings("serial")
public class SearchByCatServlet extends HttpServlet{
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		long cid = Long.parseLong(req.getParameter("id"));
		ArticleAdm aa = new ArticleAdm();
		List<Articles> art = aa.searchByCat(cid);
		
		req.setAttribute("articles", art);
		req.getRequestDispatcher("./group/result.jsp").forward(req, resp);
	}
}
